home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 21 / emacsrc / st520.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-05-14  |  1.7 KB  |  86 lines

  1. /*
  2.  * The routines in this file
  3.  * provide support for VT52 style terminals
  4.  * over a serial line. The serial I/O services are
  5.  * provided by routines in "termio.c". It compiles
  6.  * into nothing if not a VT52 style device. The
  7.  * bell on the VT52 is terrible, so the "beep"
  8.  * routine is conditionalized on defining BEL.
  9.  */
  10. #include        <stdio.h>
  11. #include        "ed.h"
  12.  
  13.  
  14. #define NROW    25                      /* Screen size.                 */
  15. #define NCOL    80                      /* Edit if you want to.         */
  16. #define BIAS    0x20                    /* Origin 0 coordinate bias.    */
  17. #define ESC     0x1B                    /* ESC character.               */
  18. #define BEL     0x07                    /* ascii bell character         */
  19.  
  20. /*
  21. extern  int     ttopen();               * Forward references.          *
  22. extern  int     ttgetc();
  23. extern  int     ttputc();
  24. extern  int     ttflush();
  25. extern  int     ttclose();
  26. extern  int     vt52move();
  27. extern  int     vt52eol();
  28. extern  int     vt52eop();
  29. extern  int     vt52beep();
  30. extern  int     vt52open();
  31. */
  32.  
  33. /*
  34.  * Dispatch table. All the
  35.  * hard fields just point into the
  36.  * terminal I/O code.
  37.  */
  38. TERM    term    = {
  39.         NROW-1,
  40.         NCOL,
  41. /*      &vt52open,
  42.         &ttclose,
  43.         &ttgetc,
  44.         &ttputc,
  45.         &ttflush,
  46.         &vt52move,
  47.         &vt52eol,
  48.         &vt52eop,
  49.         &vt52beep    */
  50. };
  51.  
  52. /*****
  53. vt52move(row, col)
  54. {
  55.         ttputc(ESC);
  56.         ttputc('Y');
  57.         ttputc(row + BIAS);
  58.         ttputc(col + BIAS);
  59. }
  60.  
  61. vt52eol()
  62. {
  63.         ttputc(ESC);
  64.         ttputc('K');
  65. }
  66.  
  67. vt52eop()
  68. {
  69.         ttputc(ESC);
  70.         ttputc('J');
  71. }
  72.  
  73. vt52beep()
  74. {
  75. }
  76.  
  77.  
  78. vt52open()
  79. {
  80.         ttopen();
  81. }
  82.  
  83. ****/
  84.  
  85. /* -eof- */
  86.